<? 	
$message = ($this->session->flashdata('message')!='')?$this->session->flashdata('message'):'0';
$err 	 = ($this->session->flashdata('err')!='')?$this->session->flashdata('err'):'0'; ?>

<script type="text/javascript">
function delete_gi_confirmation(path){
	var res=confirm("Are you sure you want to delete this image?");
	if(res==true){
		window.location.replace(path);
	}
}
</script>
<section id="content">
	<section class="container_12 clearfix">
		<section id="main" class="grid_9 push_3">			
			<article>
				<h1><?=$page_title?></h1><?
				
				if($message!='0'){?>
					 <div id="info_message"><b><?=$message?></b></div><?	
				}
				if($err!='0'){?>
					 <div id="info_error"><b><?=$err?></b></div><?	
				}
				
                $attributes = array('name' => 'hotel_image_edit', 'id' => 'hotel_image_edit', 'method' => 'post');
				echo form_open('admin/hotel/gallery/'.$hotel_image_data[0]->hotel_id.'/5/'.$hotel_image_data[0]->id, $attributes);?>
                	<input type="hidden" id="hotel_id" name="hotel_id" value="<?=$hotel_image_data[0]->hotel_id?>" /> 
                    <input type="hidden" id="image_id" name="image_id" value="<?=$hotel_image_data[0]->id?>" /> 
					<dl class="glr_img_edit">
						<dt class="gal_img_lbl"><label>Photo:</label></dt>
                        <dt class="gal_img_sprtr"><label>:</label></dt>
						<dd class="glr_img">
                        	<div class="gi_div" style="width:108px; height:108px;">
                            	<a href="<?=$img_path?>" rel="facebox"><img src="<?=$thumb_img?>" style="vertical-align:middle;"/></a>
                            </div>
                        </dd>
					
						<dt class="gal_img_lbl"><label for="photo_title">Title:</label></dt>
                        <dt class="gal_img_sprtr"><label>:</label></dt>
						<dd><input type="text" name="title" id="title" class="medium" value="<?=$hotel_image_data[0]->title?>"/></dd>
						<? $room_type = $hotel_image_data[0]->room_type_id; ?>
                       
                        <dt class="gal_img_lbl"><label for="photo_file">Room Type:</label></dt>
                        <dt class="gal_img_sprtr"><label>:</label></dt>
                        <dd><select id="room_type_id" name="room_type_id">
                                <option value="1" <?=($room_type==1)?'selected=selected':''?>> Normal </option>
                                <option value="2" <?=($room_type==2)?'selected=selected':''?>> Luxury </option>
                                <option value="3" <?=($room_type==3)?'selected=selected':''?>> Semi Luxury </option>
                                <option value="4" <?=($room_type==4)?'selected=selected':''?>> Super Luxury </option>
                            </select>
                        </dd>						
                        
                        <dt class="gal_img_lbl"><label for="photo_title">ALT Tag:</label></dt>
                        <dt class="gal_img_sprtr"><label>:</label></dt>
						<dd><input type="text" name="alt_tag" id="alt_tag" class="medium" value="<?=$hotel_image_data[0]->alt_tag?>"/></dd>
                        
                        <dt class="gal_img_lbl"><label for="photo_title">Keywords:</label></dt>
                        <dt class="gal_img_sprtr"><label>:</label></dt>
						<dd><textarea name="key_words" id="key_words" class="medium"  rows="4"><?=$hotel_image_data[0]->key_words?></textarea></dd>
                        
						<dt class="gal_img_lbl"><label for="photo_desc">Description:</label></dt>
                        <dt class="gal_img_sprtr"><label>:</label></dt>
						<dd><textarea name="description" id="description" class="medium" rows="5"><?=$hotel_image_data[0]->description?></textarea></dd>
                    
                    </dl>
                    <button class="button" type="button" onclick="location='/admin/hotel/gallery/<?=$hotel_image_data[0]->hotel_id?>/1';">Go Back</button>
					<button type="submit" class="button">Save</button>
                    <? $delete_path 		= "/admin/hotel/gallery/".$hotel_image_data[0]->hotel_id."/4/".$hotel_image_data[0]->id;?>
                    <button class="button white" type="button" onclick="javascript:delete_gi_confirmation('<?=$delete_path?>');">Delete</button></a>
				</form>
			</article>
		</section>		
	</section>
</section>